﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace EditCategories
{
    public partial class EditCategory : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void GridCategory_Sorting(object sender, GridViewSortEventArgs e)
        {
            if (e.SortExpression == "Description")
            {
                e.Cancel = true;
                ErrorDiv.Visible = true;
            }
            else
            {
                ErrorDiv.Visible = false;
            }
        }

        public void ReBind()
        {
            this.GridCategory.DataBind();
        }

        protected void FormCategory_ItemInserted(object sender, FormViewInsertedEventArgs e)
        {
            LinqDataSourceCategory.DataBind();
        }
    }
}